#include <iostream>
#include <numeric>
#include <vector>
#include <algorithm>

using namespace std;

class Solution
{
  public:
    int numOfUnplacedFruits(vector<int> &fruits, vector<int> &baskets)
    {
        for (int f = 0; f < fruits.size(); f++)
        {
            for (int b = 0; b < baskets.size(); b++)
            {
                if (baskets[b] >= fruits[f])
                {
                    baskets[b] = 0;
                    fruits[f] = 0;
                    break;
                }
            }
            if (fruits[f] != 0)
            {
                fruits[f] = 1;
            }
        }
        return accumulate(fruits.begin(),fruits.end(),0);
    }
};

int main()
{
    cout << "Code3477" << endl;
    Solution s;
    vector<int> fruits = {4,2,5};
    vector<int> baskets = {3,5,4};
    cout << s.numOfUnplacedFruits(fruits, baskets) << endl;
    return 0;
}